import nme.Lib;
import nme.Assets;
import nme.display.Graphics;
import nme.display.Sprite;
import nme.display.Bitmap;
import nme.display.BitmapData;

import nme.geom.Rectangle;
import nme.geom.Matrix;
import nme.geom.Point;

import nme.events.Event;
import nme.events.MouseEvent;
import nme.events.KeyboardEvent;

class Main extends Sprite
{
	private var _sprite:SpriteData;
	private var _menu:ContextMenu;
	private var _moduleEditor:ModuleEditor;
	
	public function new ()
	{
		super ();
		// addEventListener (Event.ENTER_FRAME, onEnterFrame);
		// addEventListener (MouseEvent.MOUSE_WHEEL, onclick);
		// addEventListener (MouseEvent.CLICK, onclick);		
		addEventListener (KeyboardEvent.KEY_DOWN, onkeyboard);
		addEventListener (Event.RESIZE, onResize);
		
		trace ("Lib.current.stage.stageWidth: " + Lib.current.stage.stageWidth);
		trace ("Lib.current.stage.stageHeight: " + Lib.current.stage.stageHeight);
		
		GameStateManager.setMain (this);
		GameStateManager.add (new Loading());
		GameStateManager.add (new Home());
	}
	
	private function onkeyboard (e:KeyboardEvent):Void
	{
		trace ("key down");
	}
	
	
	private function onResize (e:Event):Void
	{
		trace ("Lib.current.stage.stageWidth: " + Lib.current.stage.stageWidth);
		trace ("Lib.current.stage.stageHeight: " + Lib.current.stage.stageHeight);
	}
	
	private function onContextMenu (e:MouseEvent):Void
	{
	}
	
	private function onclick (e:MouseEvent):Void
	{
	}
	
	private function zoom (e:MouseEvent):Void
	{
	}
	
	private function onEnterFrame(event:Event):Void
	{
	}
}